<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CAD_Doc: Testing Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">CAD_Doc<span id="projectnumber">&#160;1.0</span>
   </div>
   <div id="projectbrief">cad synopsis</div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('md__build_2__deps_2googletest-src_2docs_2reference_2testing.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">Testing Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="autotoc_md272"></a></p>
<p>This page lists the facilities provided by GoogleTest for writing test programs. To use them, include the header <code><a class="el" href="gtest_8h_source.html">gtest/gtest.h</a></code>.</p>
<h1><a class="anchor" id="autotoc_md273"></a>
Macros</h1>
<p>GoogleTest defines the following macros for writing tests.</p>
<h2><a class="anchor" id="TEST"></a>
TEST</h2>
<pre>
TEST(<em>TestSuiteName</em>, <em>TestName</em>) {
  ... <em>statements</em> ...
}
</pre><p>Defines an individual test named <em><code>TestName</code></em> in the test suite <em><code>TestSuiteName</code></em>, consisting of the given statements.</p>
<p>Both arguments <em><code>TestSuiteName</code></em> and <em><code>TestName</code></em> must be valid C++ identifiers and must not contain underscores (<code>_</code>). Tests in different test suites can have the same individual name.</p>
<p>The statements within the test body can be any code under test. <a class="el" href="md__build_2__deps_2googletest-src_2docs_2reference_2assertions.html">Assertions</a> used within the test body determine the outcome of the test.</p>
<h2><a class="anchor" id="TEST_F"></a>
TEST_F</h2>
<pre>
TEST_F(<em>TestFixtureName</em>, <em>TestName</em>) {
  ... <em>statements</em> ...
}
</pre><p>Defines an individual test named <em><code>TestName</code></em> that uses the test fixture class <em><code>TestFixtureName</code></em>. The test suite name is <em><code>TestFixtureName</code></em>.</p>
<p>Both arguments <em><code>TestFixtureName</code></em> and <em><code>TestName</code></em> must be valid C++ identifiers and must not contain underscores (<code>_</code>). <em><code>TestFixtureName</code></em> must be the name of a test fixture class—see <a href="../primer.md#same-data-multiple-tests">Test Fixtures</a>.</p>
<p>The statements within the test body can be any code under test. <a class="el" href="md__build_2__deps_2googletest-src_2docs_2reference_2assertions.html">Assertions</a> used within the test body determine the outcome of the test.</p>
<h2><a class="anchor" id="TEST_P"></a>
TEST_P</h2>
<pre>
TEST_P(<em>TestFixtureName</em>, <em>TestName</em>) {
  ... <em>statements</em> ...
}
</pre><p>Defines an individual value-parameterized test named <em><code>TestName</code></em> that uses the test fixture class <em><code>TestFixtureName</code></em>. The test suite name is <em><code>TestFixtureName</code></em>.</p>
<p>Both arguments <em><code>TestFixtureName</code></em> and <em><code>TestName</code></em> must be valid C++ identifiers and must not contain underscores (<code>_</code>). <em><code>TestFixtureName</code></em> must be the name of a value-parameterized test fixture class—see <a href="../advanced.md#value-parameterized-tests">Value-Parameterized Tests</a>.</p>
<p>The statements within the test body can be any code under test. Within the test body, the test parameter can be accessed with the <code>GetParam()</code> function (see <a class="el" href="#WithParamInterface">`WithParamInterface`</a>). For example:</p>
<div class="fragment"><div class="line">TEST_P(MyTestSuite, DoesSomething) {</div>
<div class="line">  ...</div>
<div class="line">  EXPECT_TRUE(DoSomething(GetParam()));</div>
<div class="line">  ...</div>
<div class="line">}</div>
</div><!-- fragment --><p><a class="el" href="md__build_2__deps_2googletest-src_2docs_2reference_2assertions.html">Assertions</a> used within the test body determine the outcome of the test.</p>
<p>See also <a class="el" href="#INSTANTIATE_TEST_SUITE_P">`INSTANTIATE_TEST_SUITE_P`</a>.</p>
<h2><a class="anchor" id="INSTANTIATE_TEST_SUITE_P"></a>
INSTANTIATE_TEST_SUITE_P</h2>
<p><code>INSTANTIATE_TEST_SUITE_P(</code>*<code>InstantiationName</code>*<code>,</code>*<code>TestSuiteName</code>*<code>,</code>*<code>param_generator</code>*<code>)</code> \ <code>INSTANTIATE_TEST_SUITE_P(</code>*<code>InstantiationName</code>*<code>,</code>*<code>TestSuiteName</code>*<code>,</code>*<code>param_generator</code>*<code>,</code>*<code>name_generator</code>*<code>)</code></p>
<p>Instantiates the value-parameterized test suite <em><code>TestSuiteName</code></em> (defined with <a class="el" href="#TEST_P">`TEST_P`</a>).</p>
<p>The argument <em><code>InstantiationName</code></em> is a unique name for the instantiation of the test suite, to distinguish between multiple instantiations. In test output, the instantiation name is added as a prefix to the test suite name <em><code>TestSuiteName</code></em>.</p>
<p>The argument <em><code>param_generator</code></em> is one of the following GoogleTest-provided functions that generate the test parameters, all defined in the <code>testing</code> namespace:</p>
<p><span id="param-generators"></span></p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Parameter Generator   </th><th class="markdownTableHeadNone">Behavior    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>Range(begin, end [, step])</code>   </td><td class="markdownTableBodyNone">Yields values <code>{begin, begin+step, begin+step+step, ...}</code>. The values do not include <code>end</code>. <code>step</code> defaults to 1.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>Values(v1, v2, ..., vN)</code>   </td><td class="markdownTableBodyNone">Yields values <code>{v1, v2, ..., vN}</code>.    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>ValuesIn(container)</code> or <code>ValuesIn(begin,end)</code>   </td><td class="markdownTableBodyNone">Yields values from a C-style array, an STL-style container, or an iterator range <code>[begin, end)</code>.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>Bool()</code>   </td><td class="markdownTableBodyNone">Yields sequence <code>{false, true}</code>.    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>Combine(g1, g2, ..., gN)</code>   </td><td class="markdownTableBodyNone">Yields as <code>std::tuple</code> <em>n</em>-tuples all combinations (Cartesian product) of the values generated by the given <em>n</em> generators <code>g1</code>, <code>g2</code>, ..., <code>gN</code>.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>ConvertGenerator&lt;T&gt;(g)</code>   </td><td class="markdownTableBodyNone">Yields values generated by generator <code>g</code>, <code>static_cast</code> to <code>T</code>.   </td></tr>
</table>
<p>The optional last argument <em><code>name_generator</code></em> is a function or functor that generates custom test name suffixes based on the test parameters. The function must accept an argument of type <a class="el" href="#TestParamInfo">`TestParamInfo&lt;class ParamType&gt;`</a> and return a <code>std::string</code>. The test name suffix can only contain alphanumeric characters and underscores. GoogleTest provides <a class="el" href="#PrintToStringParamName">`PrintToStringParamName`</a>, or a custom function can be used for more control:</p>
<div class="fragment"><div class="line">INSTANTIATE_TEST_SUITE_P(</div>
<div class="line">    MyInstantiation, MyTestSuite,</div>
<div class="line">    ::testing::Values(...),</div>
<div class="line">    [](const ::testing::TestParamInfo&lt;MyTestSuite::ParamType&gt;&amp; info) {</div>
<div class="line">      <span class="comment">// Can use info.param here to generate the test suffix</span></div>
<div class="line">      std::string name = ...</div>
<div class="line">      <span class="keywordflow">return</span> name;</div>
<div class="line">    });</div>
</div><!-- fragment --><p>For more information, see <a href="../advanced.md#value-parameterized-tests">Value-Parameterized Tests</a>.</p>
<p>See also <a class="el" href="#GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST">`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST`</a>.</p>
<h2><a class="anchor" id="TYPED_TEST_SUITE"></a>
TYPED_TEST_SUITE</h2>
<p><code>TYPED_TEST_SUITE(</code>*<code>TestFixtureName</code>*<code>,</code>*<code>Types</code>*<code>)</code></p>
<p>Defines a typed test suite based on the test fixture <em><code>TestFixtureName</code></em>. The test suite name is <em><code>TestFixtureName</code></em>.</p>
<p>The argument <em><code>TestFixtureName</code></em> is a fixture class template, parameterized by a type, for example:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><span class="keyword">class </span>MyFixture : <span class="keyword">public</span> <a class="code hl_class" href="classtesting_1_1_test.html">::testing::Test</a> {</div>
<div class="line"> <span class="keyword">public</span>:</div>
<div class="line">  ...</div>
<div class="line">  <span class="keyword">using </span>List = std::list&lt;T&gt;;</div>
<div class="line">  <span class="keyword">static</span> T shared_;</div>
<div class="line">  T value_;</div>
<div class="line">};</div>
<div class="ttc" id="aclasstesting_1_1_test_html"><div class="ttname"><a href="classtesting_1_1_test.html">testing::Test</a></div><div class="ttdef"><b>Definition</b> gtest.h:242</div></div>
</div><!-- fragment --><p>The argument <em><code>Types</code></em> is a <a class="el" href="#Types">`Types`</a> object representing the list of types to run the tests on, for example:</p>
<div class="fragment"><div class="line"><span class="keyword">using </span>MyTypes = ::testing::Types&lt;char, int, unsigned int&gt;;</div>
<div class="line">TYPED_TEST_SUITE(MyFixture, MyTypes);</div>
</div><!-- fragment --><p>The type alias (<code>using</code> or <code>typedef</code>) is necessary for the <code>TYPED_TEST_SUITE</code> macro to parse correctly.</p>
<p>See also <a class="el" href="#TYPED_TEST">`TYPED_TEST`</a> and <a href="../advanced.md#typed-tests">Typed Tests</a> for more information.</p>
<h2><a class="anchor" id="TYPED_TEST"></a>
TYPED_TEST</h2>
<pre>
TYPED_TEST(<em>TestSuiteName</em>, <em>TestName</em>) {
  ... <em>statements</em> ...
}
</pre><p>Defines an individual typed test named <em><code>TestName</code></em> in the typed test suite <em><code>TestSuiteName</code></em>. The test suite must be defined with <a class="el" href="#TYPED_TEST_SUITE">`TYPED_TEST_SUITE`</a>.</p>
<p>Within the test body, the special name <code>TypeParam</code> refers to the type parameter, and <code>TestFixture</code> refers to the fixture class. See the following example:</p>
<div class="fragment"><div class="line">TYPED_TEST(MyFixture, Example) {</div>
<div class="line">  <span class="comment">// Inside a test, refer to the special name TypeParam to get the type</span></div>
<div class="line">  <span class="comment">// parameter.  Since we are inside a derived class template, C++ requires</span></div>
<div class="line">  <span class="comment">// us to visit the members of MyFixture via &#39;this&#39;.</span></div>
<div class="line">  TypeParam n = this-&gt;value_;</div>
<div class="line"> </div>
<div class="line">  <span class="comment">// To visit static members of the fixture, add the &#39;TestFixture::&#39;</span></div>
<div class="line">  <span class="comment">// prefix.</span></div>
<div class="line">  n += TestFixture::shared_;</div>
<div class="line"> </div>
<div class="line">  <span class="comment">// To refer to typedefs in the fixture, add the &#39;typename TestFixture::&#39;</span></div>
<div class="line">  <span class="comment">// prefix. The &#39;typename&#39; is required to satisfy the compiler.</span></div>
<div class="line">  <span class="keyword">typename</span> TestFixture::List values;</div>
<div class="line"> </div>
<div class="line">  values.push_back(n);</div>
<div class="line">  ...</div>
<div class="line">}</div>
</div><!-- fragment --><p>For more information, see <a href="../advanced.md#typed-tests">Typed Tests</a>.</p>
<h2><a class="anchor" id="TYPED_TEST_SUITE_P"></a>
TYPED_TEST_SUITE_P</h2>
<p><code>TYPED_TEST_SUITE_P(</code>*<code>TestFixtureName</code>*<code>)</code></p>
<p>Defines a type-parameterized test suite based on the test fixture <em><code>TestFixtureName</code></em>. The test suite name is <em><code>TestFixtureName</code></em>.</p>
<p>The argument <em><code>TestFixtureName</code></em> is a fixture class template, parameterized by a type. See <a class="el" href="#TYPED_TEST_SUITE">`TYPED_TEST_SUITE`</a> for an example.</p>
<p>See also <a class="el" href="#TYPED_TEST_P">`TYPED_TEST_P`</a> and <a href="../advanced.md#type-parameterized-tests">Type-Parameterized Tests</a> for more information.</p>
<h2><a class="anchor" id="TYPED_TEST_P"></a>
TYPED_TEST_P</h2>
<pre>
TYPED_TEST_P(<em>TestSuiteName</em>, <em>TestName</em>) {
  ... <em>statements</em> ...
}
</pre><p>Defines an individual type-parameterized test named <em><code>TestName</code></em> in the type-parameterized test suite <em><code>TestSuiteName</code></em>. The test suite must be defined with <a class="el" href="#TYPED_TEST_SUITE_P">`TYPED_TEST_SUITE_P`</a>.</p>
<p>Within the test body, the special name <code>TypeParam</code> refers to the type parameter, and <code>TestFixture</code> refers to the fixture class. See <a class="el" href="#TYPED_TEST">`TYPED_TEST`</a> for an example.</p>
<p>See also <a class="el" href="#REGISTER_TYPED_TEST_SUITE_P">`REGISTER_TYPED_TEST_SUITE_P`</a> and <a href="../advanced.md#type-parameterized-tests">Type-Parameterized Tests</a> for more information.</p>
<h2><a class="anchor" id="REGISTER_TYPED_TEST_SUITE_P"></a>
REGISTER_TYPED_TEST_SUITE_P</h2>
<p><code>REGISTER_TYPED_TEST_SUITE_P(</code>*<code>TestSuiteName</code>*<code>,</code>*<code>TestNames...</code>*<code>)</code></p>
<p>Registers the type-parameterized tests <em><code>TestNames...</code></em> of the test suite <em><code>TestSuiteName</code></em>. The test suite and tests must be defined with <a class="el" href="#TYPED_TEST_SUITE_P">`TYPED_TEST_SUITE_P`</a> and <a class="el" href="#TYPED_TEST_P">`TYPED_TEST_P`</a>.</p>
<p>For example:</p>
<div class="fragment"><div class="line"><span class="comment">// Define the test suite and tests.</span></div>
<div class="line">TYPED_TEST_SUITE_P(MyFixture);</div>
<div class="line">TYPED_TEST_P(MyFixture, HasPropertyA) { ... }</div>
<div class="line">TYPED_TEST_P(MyFixture, HasPropertyB) { ... }</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Register the tests in the test suite.</span></div>
<div class="line">REGISTER_TYPED_TEST_SUITE_P(MyFixture, HasPropertyA, HasPropertyB);</div>
</div><!-- fragment --><p>See also <a class="el" href="#INSTANTIATE_TYPED_TEST_SUITE_P">`INSTANTIATE_TYPED_TEST_SUITE_P`</a> and <a href="../advanced.md#type-parameterized-tests">Type-Parameterized Tests</a> for more information.</p>
<h2><a class="anchor" id="INSTANTIATE_TYPED_TEST_SUITE_P"></a>
INSTANTIATE_TYPED_TEST_SUITE_P</h2>
<p><code>INSTANTIATE_TYPED_TEST_SUITE_P(</code>*<code>InstantiationName</code>*<code>,</code>*<code>TestSuiteName</code>*<code>,</code>*<code>Types</code>*<code>)</code></p>
<p>Instantiates the type-parameterized test suite <em><code>TestSuiteName</code></em>. The test suite must be registered with <a class="el" href="#REGISTER_TYPED_TEST_SUITE_P">`REGISTER_TYPED_TEST_SUITE_P`</a>.</p>
<p>The argument <em><code>InstantiationName</code></em> is a unique name for the instantiation of the test suite, to distinguish between multiple instantiations. In test output, the instantiation name is added as a prefix to the test suite name <em><code>TestSuiteName</code></em>.</p>
<p>The argument <em><code>Types</code></em> is a <a class="el" href="#Types">`Types`</a> object representing the list of types to run the tests on, for example:</p>
<div class="fragment"><div class="line"><span class="keyword">using </span>MyTypes = ::testing::Types&lt;char, int, unsigned int&gt;;</div>
<div class="line">INSTANTIATE_TYPED_TEST_SUITE_P(MyInstantiation, MyFixture, MyTypes);</div>
</div><!-- fragment --><p>The type alias (<code>using</code> or <code>typedef</code>) is necessary for the <code>INSTANTIATE_TYPED_TEST_SUITE_P</code> macro to parse correctly.</p>
<p>For more information, see <a href="../advanced.md#type-parameterized-tests">Type-Parameterized Tests</a>.</p>
<h2><a class="anchor" id="FRIEND_TEST"></a>
FRIEND_TEST</h2>
<p><code>FRIEND_TEST(</code>*<code>TestSuiteName</code>*<code>,</code>*<code>TestName</code>*<code>)</code></p>
<p>Within a class body, declares an individual test as a friend of the class, enabling the test to access private class members.</p>
<p>If the class is defined in a namespace, then in order to be friends of the class, test fixtures and tests must be defined in the exact same namespace, without inline or anonymous namespaces.</p>
<p>For example, if the class definition looks like the following:</p>
<div class="fragment"><div class="line"><span class="keyword">namespace </span>my_namespace {</div>
<div class="line"> </div>
<div class="line"><span class="keyword">class </span>MyClass {</div>
<div class="line">  <span class="keyword">friend</span> <span class="keyword">class </span>MyClassTest;</div>
<div class="line">  FRIEND_TEST(MyClassTest, HasPropertyA);</div>
<div class="line">  FRIEND_TEST(MyClassTest, HasPropertyB);</div>
<div class="line">  ... definition of <span class="keyword">class </span>MyClass ...</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line">}  <span class="comment">// namespace my_namespace</span></div>
</div><!-- fragment --><p>Then the test code should look like:</p>
<div class="fragment"><div class="line"><span class="keyword">namespace </span>my_namespace {</div>
<div class="line"> </div>
<div class="line"><span class="keyword">class </span>MyClassTest : <span class="keyword">public</span> <a class="code hl_class" href="classtesting_1_1_test.html">::testing::Test</a> {</div>
<div class="line">  ...</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line">TEST_F(MyClassTest, HasPropertyA) { ... }</div>
<div class="line">TEST_F(MyClassTest, HasPropertyB) { ... }</div>
<div class="line"> </div>
<div class="line">}  <span class="comment">// namespace my_namespace</span></div>
</div><!-- fragment --><p>See <a href="../advanced.md#testing-private-code">Testing Private Code</a> for more information.</p>
<h2><a class="anchor" id="SCOPED_TRACE"></a>
SCOPED_TRACE</h2>
<p><code>SCOPED_TRACE(</code>*<code>message</code>*<code>)</code></p>
<p>Causes the current file name, line number, and the given message <em><code>message</code></em> to be added to the failure message for each assertion failure that occurs in the scope.</p>
<p>For more information, see <a href="../advanced.md#adding-traces-to-assertions">Adding Traces to Assertions</a>.</p>
<p>See also the <a class="el" href="#ScopedTrace">`ScopedTrace` class</a>.</p>
<h2><a class="anchor" id="GTEST_SKIP"></a>
GTEST_SKIP</h2>
<p><code>GTEST_SKIP()</code></p>
<p>Prevents further test execution at runtime.</p>
<p>Can be used in individual test cases or in the <code>SetUp()</code> methods of test environments or test fixtures (classes derived from the <a class="el" href="#Environment">`Environment`</a> or <a class="el" href="#Test">`Test`</a> classes). If used in a global test environment <code>SetUp()</code> method, it skips all tests in the test program. If used in a test fixture <code>SetUp()</code> method, it skips all tests in the corresponding test suite.</p>
<p>Similar to assertions, <code>GTEST_SKIP</code> allows streaming a custom message into it.</p>
<p>See <a href="../advanced.md#skipping-test-execution">Skipping Test Execution</a> for more information.</p>
<h2><a class="anchor" id="GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST"></a>
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST</h2>
<p><code>GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(</code>*<code>TestSuiteName</code>*<code>)</code></p>
<p>Allows the value-parameterized test suite <em><code>TestSuiteName</code></em> to be uninstantiated.</p>
<p>By default, every <a class="el" href="#TEST_P">`TEST_P`</a> call without a corresponding <a class="el" href="#INSTANTIATE_TEST_SUITE_P">`INSTANTIATE_TEST_SUITE_P`</a> call causes a failing test in the test suite <code>GoogleTestVerification</code>. <code>GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST</code> suppresses this failure for the given test suite.</p>
<h1><a class="anchor" id="autotoc_md274"></a>
Classes and types</h1>
<p>GoogleTest defines the following classes and types to help with writing tests.</p>
<h2><a class="anchor" id="AssertionResult"></a>
AssertionResult</h2>
<p><code>::testing::AssertionResult</code></p>
<p>A class for indicating whether an assertion was successful.</p>
<p>When the assertion wasn't successful, the <code>AssertionResult</code> object stores a non-empty failure message that can be retrieved with the object's <code>message()</code> method.</p>
<p>To create an instance of this class, use one of the factory functions <a class="el" href="#AssertionSuccess">`AssertionSuccess()`</a> or <a class="el" href="#AssertionFailure">`AssertionFailure()`</a>.</p>
<h2><a class="anchor" id="AssertionException"></a>
AssertionException</h2>
<p><code>::testing::AssertionException</code></p>
<p>Exception which can be thrown from `TestEventListener::OnTestPartResult`.</p>
<h2><a class="anchor" id="EmptyTestEventListener"></a>
EmptyTestEventListener</h2>
<p><code><a class="el" href="classtesting_1_1_empty_test_event_listener.html">testing::EmptyTestEventListener</a></code></p>
<p>Provides an empty implementation of all methods in the <a class="el" href="#TestEventListener">`TestEventListener`</a> interface, such that a subclass only needs to override the methods it cares about.</p>
<h2><a class="anchor" id="Environment"></a>
Environment</h2>
<p><code><a class="el" href="classtesting_1_1_environment.html">testing::Environment</a></code></p>
<p>Represents a global test environment. See <a href="../advanced.md#global-set-up-and-tear-down">Global Set-Up and Tear-Down</a>.</p>
<h3><a class="anchor" id="Environment-protected"></a>
Protected Methods</h3>
<h4><a class="anchor" id="autotoc_md275"></a>
SetUp {#Environment::SetUp}</h4>
<p><code>virtual void Environment::SetUp()</code></p>
<p>Override this to define how to set up the environment.</p>
<h4><a class="anchor" id="autotoc_md276"></a>
TearDown {#Environment::TearDown}</h4>
<p><code>virtual void Environment::TearDown()</code></p>
<p>Override this to define how to tear down the environment.</p>
<h2><a class="anchor" id="ScopedTrace"></a>
ScopedTrace</h2>
<p><code><a class="el" href="classtesting_1_1_scoped_trace.html">testing::ScopedTrace</a></code></p>
<p>An instance of this class causes a trace to be included in every test failure message generated by code in the scope of the lifetime of the <code>ScopedTrace</code> instance. The effect is undone with the destruction of the instance.</p>
<p>The <code>ScopedTrace</code> constructor has the following form:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line">ScopedTrace(<span class="keyword">const</span> <span class="keywordtype">char</span>* file, <span class="keywordtype">int</span> line, <span class="keyword">const</span> T&amp; message)</div>
</div><!-- fragment --><p>Example usage:</p>
<div class="fragment"><div class="line"><a class="code hl_class" href="classtesting_1_1_scoped_trace.html">::testing::ScopedTrace</a> trace(<span class="stringliteral">&quot;file.cc&quot;</span>, 123, <span class="stringliteral">&quot;message&quot;</span>);</div>
<div class="ttc" id="aclasstesting_1_1_scoped_trace_html"><div class="ttname"><a href="classtesting_1_1_scoped_trace.html">testing::ScopedTrace</a></div><div class="ttdef"><b>Definition</b> gtest.h:2045</div></div>
</div><!-- fragment --><p>The resulting trace includes the given source file path and line number, and the given message. The <code>message</code> argument can be anything streamable to <code>std::ostream</code>.</p>
<p>See also <a class="el" href="#SCOPED_TRACE">`SCOPED_TRACE`</a>.</p>
<h2><a class="anchor" id="Test"></a>
Test</h2>
<p><code><a class="el" href="classtesting_1_1_test.html">testing::Test</a></code></p>
<p>The abstract class that all tests inherit from. <code>Test</code> is not copyable.</p>
<h3><a class="anchor" id="Test-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md277"></a>
SetUpTestSuite {#Test::SetUpTestSuite}</h4>
<p><code>static void Test::SetUpTestSuite()</code></p>
<p>Performs shared setup for all tests in the test suite. GoogleTest calls <code>SetUpTestSuite()</code> before running the first test in the test suite.</p>
<h4><a class="anchor" id="autotoc_md278"></a>
TearDownTestSuite {#Test::TearDownTestSuite}</h4>
<p><code>static void Test::TearDownTestSuite()</code></p>
<p>Performs shared teardown for all tests in the test suite. GoogleTest calls <code>TearDownTestSuite()</code> after running the last test in the test suite.</p>
<h4><a class="anchor" id="autotoc_md279"></a>
HasFatalFailure {#Test::HasFatalFailure}</h4>
<p><code>static bool Test::HasFatalFailure()</code></p>
<p>Returns true if and only if the current test has a fatal failure.</p>
<h4><a class="anchor" id="autotoc_md280"></a>
HasNonfatalFailure {#Test::HasNonfatalFailure}</h4>
<p><code>static bool Test::HasNonfatalFailure()</code></p>
<p>Returns true if and only if the current test has a nonfatal failure.</p>
<h4><a class="anchor" id="autotoc_md281"></a>
HasFailure {#Test::HasFailure}</h4>
<p><code>static bool Test::HasFailure()</code></p>
<p>Returns true if and only if the current test has any failure, either fatal or nonfatal.</p>
<h4><a class="anchor" id="autotoc_md282"></a>
IsSkipped {#Test::IsSkipped}</h4>
<p><code>static bool Test::IsSkipped()</code></p>
<p>Returns true if and only if the current test was skipped.</p>
<h4><a class="anchor" id="autotoc_md283"></a>
RecordProperty {#Test::RecordProperty}</h4>
<p><code>static void Test::RecordProperty(const std::string&amp; key, const std::string&amp; value)</code> \ <code>static void Test::RecordProperty(const std::string&amp; key, int value)</code></p>
<p>Logs a property for the current test, test suite, or entire invocation of the test program. Only the last value for a given key is logged.</p>
<p>The key must be a valid XML attribute name, and cannot conflict with the ones already used by GoogleTest (<code>name</code>, <code>file</code>, <code>line</code>, <code>status</code>, <code>time</code>, <code>classname</code>, <code>type_param</code>, and <code>value_param</code>).</p>
<p><code>RecordProperty</code> is <code>public static</code> so it can be called from utility functions that are not members of the test fixture.</p>
<p>Calls to <code>RecordProperty</code> made during the lifespan of the test (from the moment its constructor starts to the moment its destructor finishes) are output in XML as attributes of the <code>&lt;testcase&gt;</code> element. Properties recorded from a fixture's <code>SetUpTestSuite</code> or <code>TearDownTestSuite</code> methods are logged as attributes of the corresponding <code>&lt;testsuite&gt;</code> element. Calls to <code>RecordProperty</code> made in the global context (before or after invocation of <code>RUN_ALL_TESTS</code> or from the <code>SetUp</code>/<code>TearDown</code> methods of registered <code><a class="el" href="class_environment.html">Environment</a></code> objects) are output as attributes of the <code>&lt;testsuites&gt;</code> element.</p>
<h3><a class="anchor" id="Test-protected"></a>
Protected Methods</h3>
<h4><a class="anchor" id="autotoc_md284"></a>
SetUp {#Test::SetUp}</h4>
<p><code>virtual void Test::SetUp()</code></p>
<p>Override this to perform test fixture setup. GoogleTest calls <code>SetUp()</code> before running each individual test.</p>
<h4><a class="anchor" id="autotoc_md285"></a>
TearDown {#Test::TearDown}</h4>
<p><code>virtual void Test::TearDown()</code></p>
<p>Override this to perform test fixture teardown. GoogleTest calls <code>TearDown()</code> after running each individual test.</p>
<h2><a class="anchor" id="TestWithParam"></a>
TestWithParam</h2>
<p><code><a class="el" href="classtesting_1_1_test_with_param.html">testing::TestWithParam</a>&lt;T&gt;</code></p>
<p>A convenience class which inherits from both <a class="el" href="#Test">`Test`</a> and <a class="el" href="#WithParamInterface">`WithParamInterface&lt;T&gt;`</a>.</p>
<h2><a class="anchor" id="TestSuite"></a>
TestSuite</h2>
<p>Represents a test suite. <code><a class="el" href="class_test_suite.html">TestSuite</a></code> is not copyable.</p>
<h3><a class="anchor" id="TestSuite-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md286"></a>
name {#TestSuite::name}</h4>
<p><code>const char* TestSuite::name() const</code></p>
<p>Gets the name of the test suite.</p>
<h4><a class="anchor" id="autotoc_md287"></a>
type_param {#TestSuite::type_param}</h4>
<p><code>const char* TestSuite::type_param() const</code></p>
<p>Returns the name of the parameter type, or <code>NULL</code> if this is not a typed or type-parameterized test suite. See <a href="../advanced.md#typed-tests">Typed Tests</a> and <a href="../advanced.md#type-parameterized-tests">Type-Parameterized Tests</a>.</p>
<h4><a class="anchor" id="autotoc_md288"></a>
should_run {#TestSuite::should_run}</h4>
<p><code>bool TestSuite::should_run() const</code></p>
<p>Returns true if any test in this test suite should run.</p>
<h4><a class="anchor" id="autotoc_md289"></a>
successful_test_count {#TestSuite::successful_test_count}</h4>
<p><code>int TestSuite::successful_test_count() const</code></p>
<p>Gets the number of successful tests in this test suite.</p>
<h4><a class="anchor" id="autotoc_md290"></a>
skipped_test_count {#TestSuite::skipped_test_count}</h4>
<p><code>int TestSuite::skipped_test_count() const</code></p>
<p>Gets the number of skipped tests in this test suite.</p>
<h4><a class="anchor" id="autotoc_md291"></a>
failed_test_count {#TestSuite::failed_test_count}</h4>
<p><code>int TestSuite::failed_test_count() const</code></p>
<p>Gets the number of failed tests in this test suite.</p>
<h4><a class="anchor" id="autotoc_md292"></a>
reportable_disabled_test_count {#TestSuite::reportable_disabled_test_count}</h4>
<p><code>int TestSuite::reportable_disabled_test_count() const</code></p>
<p>Gets the number of disabled tests that will be reported in the XML report.</p>
<h4><a class="anchor" id="autotoc_md293"></a>
disabled_test_count {#TestSuite::disabled_test_count}</h4>
<p><code>int TestSuite::disabled_test_count() const</code></p>
<p>Gets the number of disabled tests in this test suite.</p>
<h4><a class="anchor" id="autotoc_md294"></a>
reportable_test_count {#TestSuite::reportable_test_count}</h4>
<p><code>int TestSuite::reportable_test_count() const</code></p>
<p>Gets the number of tests to be printed in the XML report.</p>
<h4><a class="anchor" id="autotoc_md295"></a>
test_to_run_count {#TestSuite::test_to_run_count}</h4>
<p><code>int TestSuite::test_to_run_count() const</code></p>
<p>Get the number of tests in this test suite that should run.</p>
<h4><a class="anchor" id="autotoc_md296"></a>
total_test_count {#TestSuite::total_test_count}</h4>
<p><code>int TestSuite::total_test_count() const</code></p>
<p>Gets the number of all tests in this test suite.</p>
<h4><a class="anchor" id="autotoc_md297"></a>
Passed {#TestSuite::Passed}</h4>
<p><code>bool TestSuite::Passed() const</code></p>
<p>Returns true if and only if the test suite passed.</p>
<h4><a class="anchor" id="autotoc_md298"></a>
Failed {#TestSuite::Failed}</h4>
<p><code>bool TestSuite::Failed() const</code></p>
<p>Returns true if and only if the test suite failed.</p>
<h4><a class="anchor" id="autotoc_md299"></a>
elapsed_time {#TestSuite::elapsed_time}</h4>
<p><code>TimeInMillis TestSuite::elapsed_time() const</code></p>
<p>Returns the elapsed time, in milliseconds.</p>
<h4><a class="anchor" id="autotoc_md300"></a>
start_timestamp {#TestSuite::start_timestamp}</h4>
<p><code>TimeInMillis TestSuite::start_timestamp() const</code></p>
<p>Gets the time of the test suite start, in ms from the start of the UNIX epoch.</p>
<h4><a class="anchor" id="autotoc_md301"></a>
GetTestInfo {#TestSuite::GetTestInfo}</h4>
<p><code>const TestInfo* TestSuite::GetTestInfo(int i) const</code></p>
<p>Returns the <a class="el" href="#TestInfo">`TestInfo`</a> for the <code>i</code>-th test among all the tests. <code>i</code> can range from 0 to <code>total_test_count() - 1</code>. If <code>i</code> is not in that range, returns <code>NULL</code>.</p>
<h4><a class="anchor" id="autotoc_md302"></a>
ad_hoc_test_result {#TestSuite::ad_hoc_test_result}</h4>
<p><code>const <a class="el" href="class_test_result.html">TestResult</a>&amp; TestSuite::ad_hoc_test_result() const</code></p>
<p>Returns the <a class="el" href="#TestResult">`TestResult`</a> that holds test properties recorded during execution of <code>SetUpTestSuite</code> and <code>TearDownTestSuite</code>.</p>
<h2><a class="anchor" id="TestInfo"></a>
TestInfo</h2>
<p><code><a class="el" href="classtesting_1_1_test_info.html">testing::TestInfo</a></code></p>
<p>Stores information about a test.</p>
<h3><a class="anchor" id="TestInfo-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md303"></a>
test_suite_name {#TestInfo::test_suite_name}</h4>
<p><code>const char* TestInfo::test_suite_name() const</code></p>
<p>Returns the test suite name.</p>
<h4><a class="anchor" id="autotoc_md304"></a>
name {#TestInfo::name}</h4>
<p><code>const char* TestInfo::name() const</code></p>
<p>Returns the test name.</p>
<h4><a class="anchor" id="autotoc_md305"></a>
type_param {#TestInfo::type_param}</h4>
<p><code>const char* TestInfo::type_param() const</code></p>
<p>Returns the name of the parameter type, or <code>NULL</code> if this is not a typed or type-parameterized test. See <a href="../advanced.md#typed-tests">Typed Tests</a> and <a href="../advanced.md#type-parameterized-tests">Type-Parameterized Tests</a>.</p>
<h4><a class="anchor" id="autotoc_md306"></a>
value_param {#TestInfo::value_param}</h4>
<p><code>const char* TestInfo::value_param() const</code></p>
<p>Returns the text representation of the value parameter, or <code>NULL</code> if this is not a value-parameterized test. See <a href="../advanced.md#value-parameterized-tests">Value-Parameterized Tests</a>.</p>
<h4><a class="anchor" id="autotoc_md307"></a>
file {#TestInfo::file}</h4>
<p><code>const char* TestInfo::file() const</code></p>
<p>Returns the file name where this test is defined.</p>
<h4><a class="anchor" id="autotoc_md308"></a>
line {#TestInfo::line}</h4>
<p><code>int TestInfo::line() const</code></p>
<p>Returns the line where this test is defined.</p>
<h4><a class="anchor" id="autotoc_md309"></a>
is_in_another_shard {#TestInfo::is_in_another_shard}</h4>
<p><code>bool TestInfo::is_in_another_shard() const</code></p>
<p>Returns true if this test should not be run because it's in another shard.</p>
<h4><a class="anchor" id="autotoc_md310"></a>
should_run {#TestInfo::should_run}</h4>
<p><code>bool TestInfo::should_run() const</code></p>
<p>Returns true if this test should run, that is if the test is not disabled (or it is disabled but the <code>also_run_disabled_tests</code> flag has been specified) and its full name matches the user-specified filter.</p>
<p>GoogleTest allows the user to filter the tests by their full names. Only the tests that match the filter will run. See <a href="../advanced.md#running-a-subset-of-the-tests">Running a Subset of the Tests</a> for more information.</p>
<h4><a class="anchor" id="autotoc_md311"></a>
is_reportable {#TestInfo::is_reportable}</h4>
<p><code>bool TestInfo::is_reportable() const</code></p>
<p>Returns true if and only if this test will appear in the XML report.</p>
<h4><a class="anchor" id="autotoc_md312"></a>
result {#TestInfo::result}</h4>
<p><code>const TestResult* TestInfo::result() const</code></p>
<p>Returns the result of the test. See <a class="el" href="#TestResult">`TestResult`</a>.</p>
<h2><a class="anchor" id="TestParamInfo"></a>
TestParamInfo</h2>
<p><code><a class="el" href="structtesting_1_1_test_param_info.html">testing::TestParamInfo</a>&lt;T&gt;</code></p>
<p>Describes a parameter to a value-parameterized test. The type <code>T</code> is the type of the parameter.</p>
<p>Contains the fields <code>param</code> and <code>index</code> which hold the value of the parameter and its integer index respectively.</p>
<h2><a class="anchor" id="UnitTest"></a>
UnitTest</h2>
<p><code><a class="el" href="classtesting_1_1_unit_test.html">testing::UnitTest</a></code></p>
<p>This class contains information about the test program.</p>
<p><code><a class="el" href="class_unit_test.html">UnitTest</a></code> is a singleton class. The only instance is created when <code>UnitTest::GetInstance()</code> is first called. This instance is never deleted.</p>
<p><code><a class="el" href="class_unit_test.html">UnitTest</a></code> is not copyable.</p>
<h3><a class="anchor" id="UnitTest-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md313"></a>
GetInstance {#UnitTest::GetInstance}</h4>
<p><code>static UnitTest* UnitTest::GetInstance()</code></p>
<p>Gets the singleton <code><a class="el" href="class_unit_test.html">UnitTest</a></code> object. The first time this method is called, a <code><a class="el" href="class_unit_test.html">UnitTest</a></code> object is constructed and returned. Consecutive calls will return the same object.</p>
<h4><a class="anchor" id="autotoc_md314"></a>
original_working_dir {#UnitTest::original_working_dir}</h4>
<p><code>const char* UnitTest::original_working_dir() const</code></p>
<p>Returns the working directory when the first <a class="el" href="#TEST">`TEST()`</a> or <a class="el" href="#TEST_F">`TEST_F()`</a> was executed. The <code><a class="el" href="class_unit_test.html">UnitTest</a></code> object owns the string.</p>
<h4><a class="anchor" id="autotoc_md315"></a>
current_test_suite {#UnitTest::current_test_suite}</h4>
<p><code>const TestSuite* UnitTest::current_test_suite() const</code></p>
<p>Returns the <a class="el" href="#TestSuite">`TestSuite`</a> object for the test that's currently running, or <code>NULL</code> if no test is running.</p>
<h4><a class="anchor" id="autotoc_md316"></a>
current_test_info {#UnitTest::current_test_info}</h4>
<p><code>const TestInfo* UnitTest::current_test_info() const</code></p>
<p>Returns the <a class="el" href="#TestInfo">`TestInfo`</a> object for the test that's currently running, or <code>NULL</code> if no test is running.</p>
<h4><a class="anchor" id="autotoc_md317"></a>
random_seed {#UnitTest::random_seed}</h4>
<p><code>int UnitTest::random_seed() const</code></p>
<p>Returns the random seed used at the start of the current test run.</p>
<h4><a class="anchor" id="autotoc_md318"></a>
successful_test_suite_count {#UnitTest::successful_test_suite_count}</h4>
<p><code>int UnitTest::successful_test_suite_count() const</code></p>
<p>Gets the number of successful test suites.</p>
<h4><a class="anchor" id="autotoc_md319"></a>
failed_test_suite_count {#UnitTest::failed_test_suite_count}</h4>
<p><code>int UnitTest::failed_test_suite_count() const</code></p>
<p>Gets the number of failed test suites.</p>
<h4><a class="anchor" id="autotoc_md320"></a>
total_test_suite_count {#UnitTest::total_test_suite_count}</h4>
<p><code>int UnitTest::total_test_suite_count() const</code></p>
<p>Gets the number of all test suites.</p>
<h4><a class="anchor" id="autotoc_md321"></a>
test_suite_to_run_count {#UnitTest::test_suite_to_run_count}</h4>
<p><code>int UnitTest::test_suite_to_run_count() const</code></p>
<p>Gets the number of all test suites that contain at least one test that should run.</p>
<h4><a class="anchor" id="autotoc_md322"></a>
successful_test_count {#UnitTest::successful_test_count}</h4>
<p><code>int UnitTest::successful_test_count() const</code></p>
<p>Gets the number of successful tests.</p>
<h4><a class="anchor" id="autotoc_md323"></a>
skipped_test_count {#UnitTest::skipped_test_count}</h4>
<p><code>int UnitTest::skipped_test_count() const</code></p>
<p>Gets the number of skipped tests.</p>
<h4><a class="anchor" id="autotoc_md324"></a>
failed_test_count {#UnitTest::failed_test_count}</h4>
<p><code>int UnitTest::failed_test_count() const</code></p>
<p>Gets the number of failed tests.</p>
<h4><a class="anchor" id="autotoc_md325"></a>
reportable_disabled_test_count {#UnitTest::reportable_disabled_test_count}</h4>
<p><code>int UnitTest::reportable_disabled_test_count() const</code></p>
<p>Gets the number of disabled tests that will be reported in the XML report.</p>
<h4><a class="anchor" id="autotoc_md326"></a>
disabled_test_count {#UnitTest::disabled_test_count}</h4>
<p><code>int UnitTest::disabled_test_count() const</code></p>
<p>Gets the number of disabled tests.</p>
<h4><a class="anchor" id="autotoc_md327"></a>
reportable_test_count {#UnitTest::reportable_test_count}</h4>
<p><code>int UnitTest::reportable_test_count() const</code></p>
<p>Gets the number of tests to be printed in the XML report.</p>
<h4><a class="anchor" id="autotoc_md328"></a>
total_test_count {#UnitTest::total_test_count}</h4>
<p><code>int UnitTest::total_test_count() const</code></p>
<p>Gets the number of all tests.</p>
<h4><a class="anchor" id="autotoc_md329"></a>
test_to_run_count {#UnitTest::test_to_run_count}</h4>
<p><code>int UnitTest::test_to_run_count() const</code></p>
<p>Gets the number of tests that should run.</p>
<h4><a class="anchor" id="autotoc_md330"></a>
start_timestamp {#UnitTest::start_timestamp}</h4>
<p><code>TimeInMillis UnitTest::start_timestamp() const</code></p>
<p>Gets the time of the test program start, in ms from the start of the UNIX epoch.</p>
<h4><a class="anchor" id="autotoc_md331"></a>
elapsed_time {#UnitTest::elapsed_time}</h4>
<p><code>TimeInMillis UnitTest::elapsed_time() const</code></p>
<p>Gets the elapsed time, in milliseconds.</p>
<h4><a class="anchor" id="autotoc_md332"></a>
Passed {#UnitTest::Passed}</h4>
<p><code>bool UnitTest::Passed() const</code></p>
<p>Returns true if and only if the unit test passed (i.e. all test suites passed).</p>
<h4><a class="anchor" id="autotoc_md333"></a>
Failed {#UnitTest::Failed}</h4>
<p><code>bool UnitTest::Failed() const</code></p>
<p>Returns true if and only if the unit test failed (i.e. some test suite failed or something outside of all tests failed).</p>
<h4><a class="anchor" id="autotoc_md334"></a>
GetTestSuite {#UnitTest::GetTestSuite}</h4>
<p><code>const TestSuite* UnitTest::GetTestSuite(int i) const</code></p>
<p>Gets the <a class="el" href="#TestSuite">`TestSuite`</a> object for the <code>i</code>-th test suite among all the test suites. <code>i</code> can range from 0 to <code>total_test_suite_count() - 1</code>. If <code>i</code> is not in that range, returns <code>NULL</code>.</p>
<h4><a class="anchor" id="autotoc_md335"></a>
ad_hoc_test_result {#UnitTest::ad_hoc_test_result}</h4>
<p><code>const <a class="el" href="class_test_result.html">TestResult</a>&amp; UnitTest::ad_hoc_test_result() const</code></p>
<p>Returns the <a class="el" href="#TestResult">`TestResult`</a> containing information on test failures and properties logged outside of individual test suites.</p>
<h4><a class="anchor" id="autotoc_md336"></a>
listeners {#UnitTest::listeners}</h4>
<p><code><a class="el" href="class_test_event_listeners.html">TestEventListeners</a>&amp; UnitTest::listeners()</code></p>
<p>Returns the list of event listeners that can be used to track events inside GoogleTest. See <a class="el" href="#TestEventListeners">`TestEventListeners`</a>.</p>
<h2><a class="anchor" id="TestEventListener"></a>
TestEventListener</h2>
<p><code><a class="el" href="classtesting_1_1_test_event_listener.html">testing::TestEventListener</a></code></p>
<p>The interface for tracing execution of tests. The methods below are listed in the order the corresponding events are fired.</p>
<h3><a class="anchor" id="TestEventListener-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md337"></a>
OnTestProgramStart {#TestEventListener::OnTestProgramStart}</h4>
<p><code>virtual void TestEventListener::OnTestProgramStart(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test)</code></p>
<p>Fired before any test activity starts.</p>
<h4><a class="anchor" id="autotoc_md338"></a>
OnTestIterationStart {#TestEventListener::OnTestIterationStart}</h4>
<p><code>virtual void TestEventListener::OnTestIterationStart(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test, int iteration)</code></p>
<p>Fired before each iteration of tests starts. There may be more than one iteration if <code>GTEST_FLAG(repeat)</code> is set. <code>iteration</code> is the iteration index, starting from 0.</p>
<h4><a class="anchor" id="autotoc_md339"></a>
OnEnvironmentsSetUpStart {#TestEventListener::OnEnvironmentsSetUpStart}</h4>
<p><code>virtual void TestEventListener::OnEnvironmentsSetUpStart(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test)</code></p>
<p>Fired before environment set-up for each iteration of tests starts.</p>
<h4><a class="anchor" id="autotoc_md340"></a>
OnEnvironmentsSetUpEnd {#TestEventListener::OnEnvironmentsSetUpEnd}</h4>
<p><code>virtual void TestEventListener::OnEnvironmentsSetUpEnd(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test)</code></p>
<p>Fired after environment set-up for each iteration of tests ends.</p>
<h4><a class="anchor" id="autotoc_md341"></a>
OnTestSuiteStart {#TestEventListener::OnTestSuiteStart}</h4>
<p><code>virtual void TestEventListener::OnTestSuiteStart(const <a class="el" href="class_test_suite.html">TestSuite</a>&amp; test_suite)</code></p>
<p>Fired before the test suite starts.</p>
<h4><a class="anchor" id="autotoc_md342"></a>
OnTestStart {#TestEventListener::OnTestStart}</h4>
<p><code>virtual void TestEventListener::OnTestStart(const <a class="el" href="class_test_info.html">TestInfo</a>&amp; test_info)</code></p>
<p>Fired before the test starts.</p>
<h4><a class="anchor" id="autotoc_md343"></a>
OnTestPartResult {#TestEventListener::OnTestPartResult}</h4>
<p><code>virtual void TestEventListener::OnTestPartResult(const TestPartResult&amp; test_part_result)</code></p>
<p>Fired after a failed assertion or a <code>SUCCEED()</code> invocation. If you want to throw an exception from this function to skip to the next test, it must be an <a class="el" href="#AssertionException">`AssertionException`</a> or inherited from it.</p>
<h4><a class="anchor" id="autotoc_md344"></a>
OnTestEnd {#TestEventListener::OnTestEnd}</h4>
<p><code>virtual void TestEventListener::OnTestEnd(const <a class="el" href="class_test_info.html">TestInfo</a>&amp; test_info)</code></p>
<p>Fired after the test ends.</p>
<h4><a class="anchor" id="autotoc_md345"></a>
OnTestSuiteEnd {#TestEventListener::OnTestSuiteEnd}</h4>
<p><code>virtual void TestEventListener::OnTestSuiteEnd(const <a class="el" href="class_test_suite.html">TestSuite</a>&amp; test_suite)</code></p>
<p>Fired after the test suite ends.</p>
<h4><a class="anchor" id="autotoc_md346"></a>
OnEnvironmentsTearDownStart {#TestEventListener::OnEnvironmentsTearDownStart}</h4>
<p><code>virtual void TestEventListener::OnEnvironmentsTearDownStart(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test)</code></p>
<p>Fired before environment tear-down for each iteration of tests starts.</p>
<h4><a class="anchor" id="autotoc_md347"></a>
OnEnvironmentsTearDownEnd {#TestEventListener::OnEnvironmentsTearDownEnd}</h4>
<p><code>virtual void TestEventListener::OnEnvironmentsTearDownEnd(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test)</code></p>
<p>Fired after environment tear-down for each iteration of tests ends.</p>
<h4><a class="anchor" id="autotoc_md348"></a>
OnTestIterationEnd {#TestEventListener::OnTestIterationEnd}</h4>
<p><code>virtual void TestEventListener::OnTestIterationEnd(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test, int iteration)</code></p>
<p>Fired after each iteration of tests finishes.</p>
<h4><a class="anchor" id="autotoc_md349"></a>
OnTestProgramEnd {#TestEventListener::OnTestProgramEnd}</h4>
<p><code>virtual void TestEventListener::OnTestProgramEnd(const <a class="el" href="class_unit_test.html">UnitTest</a>&amp; unit_test)</code></p>
<p>Fired after all test activities have ended.</p>
<h2><a class="anchor" id="TestEventListeners"></a>
TestEventListeners</h2>
<p><code><a class="el" href="classtesting_1_1_test_event_listeners.html">testing::TestEventListeners</a></code></p>
<p>Lets users add listeners to track events in GoogleTest.</p>
<h3><a class="anchor" id="TestEventListeners-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md350"></a>
Append {#TestEventListeners::Append}</h4>
<p><code>void TestEventListeners::Append(TestEventListener* listener)</code></p>
<p>Appends an event listener to the end of the list. GoogleTest assumes ownership of the listener (i.e. it will delete the listener when the test program finishes).</p>
<h4><a class="anchor" id="autotoc_md351"></a>
Release {#TestEventListeners::Release}</h4>
<p><code>TestEventListener* TestEventListeners::Release(TestEventListener* listener)</code></p>
<p>Removes the given event listener from the list and returns it. It then becomes the caller's responsibility to delete the listener. Returns <code>NULL</code> if the listener is not found in the list.</p>
<h4><a class="anchor" id="autotoc_md352"></a>
default_result_printer {#TestEventListeners::default_result_printer}</h4>
<p><code>TestEventListener* TestEventListeners::default_result_printer() const</code></p>
<p>Returns the standard listener responsible for the default console output. Can be removed from the listeners list to shut down default console output. Note that removing this object from the listener list with `Release()` transfers its ownership to the caller and makes this function return <code>NULL</code> the next time.</p>
<h4><a class="anchor" id="autotoc_md353"></a>
default_xml_generator {#TestEventListeners::default_xml_generator}</h4>
<p><code>TestEventListener* TestEventListeners::default_xml_generator() const</code></p>
<p>Returns the standard listener responsible for the default XML output controlled by the <code>--gtest_output=xml</code> flag. Can be removed from the listeners list by users who want to shut down the default XML output controlled by this flag and substitute it with custom one. Note that removing this object from the listener list with `Release()` transfers its ownership to the caller and makes this function return <code>NULL</code> the next time.</p>
<h2><a class="anchor" id="TestPartResult"></a>
TestPartResult</h2>
<p><code>::testing::TestPartResult</code></p>
<p>A copyable object representing the result of a test part (i.e. an assertion or an explicit <code>FAIL()</code>, <code>ADD_FAILURE()</code>, or <code>SUCCESS()</code>).</p>
<h3><a class="anchor" id="TestPartResult-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md354"></a>
type {#TestPartResult::type}</h4>
<p><code>Type TestPartResult::type() const</code></p>
<p>Gets the outcome of the test part.</p>
<p>The return type <code>Type</code> is an enum defined as follows:</p>
<div class="fragment"><div class="line"><span class="keyword">enum</span> Type {</div>
<div class="line">  kSuccess,          <span class="comment">// Succeeded.</span></div>
<div class="line">  kNonFatalFailure,  <span class="comment">// Failed but the test can continue.</span></div>
<div class="line">  kFatalFailure,     <span class="comment">// Failed and the test should be terminated.</span></div>
<div class="line">  kSkip              <span class="comment">// Skipped.</span></div>
<div class="line">};</div>
</div><!-- fragment --><h4><a class="anchor" id="autotoc_md355"></a>
file_name {#TestPartResult::file_name}</h4>
<p><code>const char* TestPartResult::file_name() const</code></p>
<p>Gets the name of the source file where the test part took place, or <code>NULL</code> if it's unknown.</p>
<h4><a class="anchor" id="autotoc_md356"></a>
line_number {#TestPartResult::line_number}</h4>
<p><code>int TestPartResult::line_number() const</code></p>
<p>Gets the line in the source file where the test part took place, or <code>-1</code> if it's unknown.</p>
<h4><a class="anchor" id="autotoc_md357"></a>
summary {#TestPartResult::summary}</h4>
<p><code>const char* TestPartResult::summary() const</code></p>
<p>Gets the summary of the failure message.</p>
<h4><a class="anchor" id="autotoc_md358"></a>
message {#TestPartResult::message}</h4>
<p><code>const char* TestPartResult::message() const</code></p>
<p>Gets the message associated with the test part.</p>
<h4><a class="anchor" id="autotoc_md359"></a>
skipped {#TestPartResult::skipped}</h4>
<p><code>bool TestPartResult::skipped() const</code></p>
<p>Returns true if and only if the test part was skipped.</p>
<h4><a class="anchor" id="autotoc_md360"></a>
passed {#TestPartResult::passed}</h4>
<p><code>bool TestPartResult::passed() const</code></p>
<p>Returns true if and only if the test part passed.</p>
<h4><a class="anchor" id="autotoc_md361"></a>
nonfatally_failed {#TestPartResult::nonfatally_failed}</h4>
<p><code>bool TestPartResult::nonfatally_failed() const</code></p>
<p>Returns true if and only if the test part non-fatally failed.</p>
<h4><a class="anchor" id="autotoc_md362"></a>
fatally_failed {#TestPartResult::fatally_failed}</h4>
<p><code>bool TestPartResult::fatally_failed() const</code></p>
<p>Returns true if and only if the test part fatally failed.</p>
<h4><a class="anchor" id="autotoc_md363"></a>
failed {#TestPartResult::failed}</h4>
<p><code>bool TestPartResult::failed() const</code></p>
<p>Returns true if and only if the test part failed.</p>
<h2><a class="anchor" id="TestProperty"></a>
TestProperty</h2>
<p><code><a class="el" href="classtesting_1_1_test_property.html">testing::TestProperty</a></code></p>
<p>A copyable object representing a user-specified test property which can be output as a key/value string pair.</p>
<h3><a class="anchor" id="TestProperty-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="key"></a>
key</h4>
<p><code>const char* key() const</code></p>
<p>Gets the user-supplied key.</p>
<h4><a class="anchor" id="value"></a>
value</h4>
<p><code>const char* value() const</code></p>
<p>Gets the user-supplied value.</p>
<h4><a class="anchor" id="SetValue"></a>
SetValue</h4>
<p><code>void SetValue(const std::string&amp; new_value)</code></p>
<p>Sets a new value, overriding the previous one.</p>
<h2><a class="anchor" id="TestResult"></a>
TestResult</h2>
<p><code><a class="el" href="classtesting_1_1_test_result.html">testing::TestResult</a></code></p>
<p>Contains information about the result of a single test.</p>
<p><code><a class="el" href="class_test_result.html">TestResult</a></code> is not copyable.</p>
<h3><a class="anchor" id="TestResult-public"></a>
Public Methods</h3>
<h4><a class="anchor" id="autotoc_md364"></a>
total_part_count {#TestResult::total_part_count}</h4>
<p><code>int TestResult::total_part_count() const</code></p>
<p>Gets the number of all test parts. This is the sum of the number of successful test parts and the number of failed test parts.</p>
<h4><a class="anchor" id="autotoc_md365"></a>
test_property_count {#TestResult::test_property_count}</h4>
<p><code>int TestResult::test_property_count() const</code></p>
<p>Returns the number of test properties.</p>
<h4><a class="anchor" id="autotoc_md366"></a>
Passed {#TestResult::Passed}</h4>
<p><code>bool TestResult::Passed() const</code></p>
<p>Returns true if and only if the test passed (i.e. no test part failed).</p>
<h4><a class="anchor" id="autotoc_md367"></a>
Skipped {#TestResult::Skipped}</h4>
<p><code>bool TestResult::Skipped() const</code></p>
<p>Returns true if and only if the test was skipped.</p>
<h4><a class="anchor" id="autotoc_md368"></a>
Failed {#TestResult::Failed}</h4>
<p><code>bool TestResult::Failed() const</code></p>
<p>Returns true if and only if the test failed.</p>
<h4><a class="anchor" id="autotoc_md369"></a>
HasFatalFailure {#TestResult::HasFatalFailure}</h4>
<p><code>bool TestResult::HasFatalFailure() const</code></p>
<p>Returns true if and only if the test fatally failed.</p>
<h4><a class="anchor" id="autotoc_md370"></a>
HasNonfatalFailure {#TestResult::HasNonfatalFailure}</h4>
<p><code>bool TestResult::HasNonfatalFailure() const</code></p>
<p>Returns true if and only if the test has a non-fatal failure.</p>
<h4><a class="anchor" id="autotoc_md371"></a>
elapsed_time {#TestResult::elapsed_time}</h4>
<p><code>TimeInMillis TestResult::elapsed_time() const</code></p>
<p>Returns the elapsed time, in milliseconds.</p>
<h4><a class="anchor" id="autotoc_md372"></a>
start_timestamp {#TestResult::start_timestamp}</h4>
<p><code>TimeInMillis TestResult::start_timestamp() const</code></p>
<p>Gets the time of the test case start, in ms from the start of the UNIX epoch.</p>
<h4><a class="anchor" id="autotoc_md373"></a>
GetTestPartResult {#TestResult::GetTestPartResult}</h4>
<p><code>const TestPartResult&amp; TestResult::GetTestPartResult(int i) const</code></p>
<p>Returns the <a class="el" href="#TestPartResult">`TestPartResult`</a> for the <code>i</code>-th test part result among all the results. <code>i</code> can range from 0 to <code>total_part_count() - 1</code>. If <code>i</code> is not in that range, aborts the program.</p>
<h4><a class="anchor" id="autotoc_md374"></a>
GetTestProperty {#TestResult::GetTestProperty}</h4>
<p><code>const <a class="el" href="class_test_property.html">TestProperty</a>&amp; TestResult::GetTestProperty(int i) const</code></p>
<p>Returns the <a class="el" href="#TestProperty">`TestProperty`</a> object for the <code>i</code>-th test property. <code>i</code> can range from 0 to <code>test_property_count() - 1</code>. If <code>i</code> is not in that range, aborts the program.</p>
<h2><a class="anchor" id="TimeInMillis"></a>
TimeInMillis</h2>
<p><code>testing::TimeInMillis</code></p>
<p>An integer type representing time in milliseconds.</p>
<h2><a class="anchor" id="Types"></a>
Types</h2>
<p><code>testing::Types&lt;T...&gt;</code></p>
<p>Represents a list of types for use in typed tests and type-parameterized tests.</p>
<p>The template argument <code>T...</code> can be any number of types, for example:</p>
<div class="fragment"><div class="line">::testing::Types&lt;char, int, unsigned int&gt;</div>
</div><!-- fragment --><p>See <a href="../advanced.md#typed-tests">Typed Tests</a> and <a href="../advanced.md#type-parameterized-tests">Type-Parameterized Tests</a> for more information.</p>
<h2><a class="anchor" id="WithParamInterface"></a>
WithParamInterface</h2>
<p><code><a class="el" href="classtesting_1_1_with_param_interface.html">testing::WithParamInterface</a>&lt;T&gt;</code></p>
<p>The pure interface class that all value-parameterized tests inherit from.</p>
<p>A value-parameterized test fixture class must inherit from both <a class="el" href="#Test">`Test`</a> and <code>WithParamInterface</code>. In most cases that just means inheriting from <a class="el" href="#TestWithParam">`TestWithParam`</a>, but more complicated test hierarchies may need to inherit from <code>Test</code> and <code>WithParamInterface</code> at different levels.</p>
<p>This interface defines the type alias <code>ParamType</code> for the parameter type <code>T</code> and has support for accessing the test parameter value via the <code>GetParam()</code> method:</p>
<div class="fragment"><div class="line">static const ParamType&amp; GetParam()</div>
</div><!-- fragment --><p>For more information, see <a href="../advanced.md#value-parameterized-tests">Value-Parameterized Tests</a>.</p>
<h1><a class="anchor" id="autotoc_md375"></a>
Functions</h1>
<p>GoogleTest defines the following functions to help with writing and running tests.</p>
<h2><a class="anchor" id="InitGoogleTest"></a>
InitGoogleTest</h2>
<p><code>void testing::InitGoogleTest(int* argc, char** argv)</code> \ <code>void testing::InitGoogleTest(int* argc, wchar_t** argv)</code> \ <code>void testing::InitGoogleTest()</code></p>
<p>Initializes GoogleTest. This must be called before calling <a class="el" href="#RUN_ALL_TESTS">`RUN_ALL_TESTS()`</a>. In particular, it parses the command line for the flags that GoogleTest recognizes. Whenever a GoogleTest flag is seen, it is removed from <code>argv</code>, and <code>*argc</code> is decremented.</p>
<p>No value is returned. Instead, the GoogleTest flag variables are updated.</p>
<p>The <code>InitGoogleTest(int* argc, wchar_t** argv)</code> overload can be used in Windows programs compiled in <code>UNICODE</code> mode.</p>
<p>The argument-less <code>InitGoogleTest()</code> overload can be used on Arduino/embedded platforms where there is no <code>argc</code>/<code>argv</code>.</p>
<h2><a class="anchor" id="AddGlobalTestEnvironment"></a>
AddGlobalTestEnvironment</h2>
<p><code>Environment* ::testing::AddGlobalTestEnvironment(Environment* env)</code></p>
<p>Adds a test environment to the test program. Must be called before <a class="el" href="#RUN_ALL_TESTS">`RUN_ALL_TESTS()`</a> is called. See <a href="../advanced.md#global-set-up-and-tear-down">Global Set-Up and Tear-Down</a> for more information.</p>
<p>See also <a class="el" href="#Environment">`Environment`</a>.</p>
<h2><a class="anchor" id="RegisterTest"></a>
RegisterTest</h2>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> Factory&gt;</div>
<div class="line"><a class="code hl_class" href="class_test_info.html">TestInfo</a>* ::testing::RegisterTest(<span class="keyword">const</span> <span class="keywordtype">char</span>* test_suite_name, <span class="keyword">const</span> <span class="keywordtype">char</span>* test_name,</div>
<div class="line">                                  <span class="keyword">const</span> <span class="keywordtype">char</span>* type_param, <span class="keyword">const</span> <span class="keywordtype">char</span>* value_param,</div>
<div class="line">                                  <span class="keyword">const</span> <span class="keywordtype">char</span>* file, <span class="keywordtype">int</span> line, Factory factory)</div>
<div class="ttc" id="aclass_test_info_html"><div class="ttname"><a href="class_test_info.html">TestInfo</a></div><div class="ttdef"><b>Definition</b> gtest.h:527</div></div>
</div><!-- fragment --><p>Dynamically registers a test with the framework.</p>
<p>The <code>factory</code> argument is a factory callable (move-constructible) object or function pointer that creates a new instance of the <code>Test</code> object. It handles ownership to the caller. The signature of the callable is <code>Fixture*()</code>, where <code><a class="el" href="class_fixture.html">Fixture</a></code> is the test fixture class for the test. All tests registered with the same <code>test_suite_name</code> must return the same fixture type. This is checked at runtime.</p>
<p>The framework will infer the fixture class from the factory and will call the <code>SetUpTestSuite</code> and <code>TearDownTestSuite</code> methods for it.</p>
<p>Must be called before <a class="el" href="#RUN_ALL_TESTS">`RUN_ALL_TESTS()`</a> is invoked, otherwise behavior is undefined.</p>
<p>See <a href="../advanced.md#registering-tests-programmatically">Registering tests programmatically</a> for more information.</p>
<h2><a class="anchor" id="RUN_ALL_TESTS"></a>
RUN_ALL_TESTS</h2>
<p><code>int RUN_ALL_TESTS()</code></p>
<p>Use this function in <code>main()</code> to run all tests. It returns <code>0</code> if all tests are successful, or <code>1</code> otherwise.</p>
<p><code>RUN_ALL_TESTS()</code> should be invoked after the command line has been parsed by <a class="el" href="#InitGoogleTest">`InitGoogleTest()`</a>.</p>
<p>This function was formerly a macro; thus, it is in the global namespace and has an all-caps name.</p>
<h2><a class="anchor" id="AssertionSuccess"></a>
AssertionSuccess</h2>
<p><code>AssertionResult testing::AssertionSuccess()</code></p>
<p>Creates a successful assertion result. See <a class="el" href="#AssertionResult">`AssertionResult`</a>.</p>
<h2><a class="anchor" id="AssertionFailure"></a>
AssertionFailure</h2>
<p><code>AssertionResult testing::AssertionFailure()</code></p>
<p>Creates a failed assertion result. Use the <code>&lt;&lt;</code> operator to store a failure message:</p>
<div class="fragment"><div class="line">::testing::AssertionFailure() &lt;&lt; <span class="stringliteral">&quot;My failure message&quot;</span>;</div>
</div><!-- fragment --><p>See <a class="el" href="#AssertionResult">`AssertionResult`</a>.</p>
<h2><a class="anchor" id="StaticAssertTypeEq"></a>
StaticAssertTypeEq</h2>
<p><code>testing::StaticAssertTypeEq&lt;T1, T2&gt;()</code></p>
<p>Compile-time assertion for type equality. Compiles if and only if <code>T1</code> and <code>T2</code> are the same type. The value it returns is irrelevant.</p>
<p>See <a href="../advanced.md#type-assertions">Type Assertions</a> for more information.</p>
<h2><a class="anchor" id="PrintToString"></a>
PrintToString</h2>
<p><code>std::string ::testing::PrintToString(x)</code></p>
<p>Prints any value <code>x</code> using GoogleTest's value printer.</p>
<p>See <a href="../advanced.md#teaching-googletest-how-to-print-your-values">Teaching GoogleTest How to Print Your Values</a> for more information.</p>
<h2><a class="anchor" id="PrintToStringParamName"></a>
PrintToStringParamName</h2>
<p><code>std::string <a class="el" href="structtesting_1_1_print_to_string_param_name.html">testing::PrintToStringParamName</a>(TestParamInfo&lt;T&gt;&amp; info)</code></p>
<p>A built-in parameterized test name generator which returns the result of <a class="el" href="#PrintToString">`PrintToString`</a> called on <code>info.param</code>. Does not work when the test parameter is a <code>std::string</code> or C string. See <a href="../advanced.md#specifying-names-for-value-parameterized-test-parameters">Specifying Names for Value-Parameterized Test Parameters</a> for more information.</p>
<p>See also <a class="el" href="#TestParamInfo">`TestParamInfo`</a> and <a class="el" href="#INSTANTIATE_TEST_SUITE_P">`INSTANTIATE_TEST_SUITE_P`</a>. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
  </ul>
</div>
</body>
</html>
